/*************************************************************************
	> File Name: sort.cpp
	> Author: zhaopeng
	> Mail: zhaopeng@miaozhen.com 
	> Created Time: Thu 09 Feb 2017 06:31:06 PM CST
 ************************************************************************/

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <fstream>
#include <set>

using namespace std;

int main(int argc, char* argv[])
{
    if( 3!= argc)
    {
        cout<<"wrong paramter\n";
        return -1;
    }
    
    ifstream ifile(argv[1]);
    set<string> lines;
    string line;

    while(ifile>>line)
    {
        lines.insert(line);
    }
    
   
    ofstream fout;
    fout.open(argv[2]);
    set<string>::iterator itor;
    for(itor=lines.begin(); itor!=lines.end(); itor++)
    {
        fout<<*itor<<endl;
    }
    return 0;
}



